package com.yango.serviceutil.exception;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Li.Ding.yin
 * @create 2021年07月22日10:29-星期四
 * @role 自定义异常类
 */
@Data
@NoArgsConstructor//无参构造
@AllArgsConstructor//有参构造
public class YangoException extends RuntimeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;

    @ApiModelProperty(value = "返回消息")
    private String message;

    @Override
    public String toString() {
        return "YangoException{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
